import {ref} from "vue";

export interface ICarouse {
    uid: string,
    title: string
    url: string
    target: string
}

export function useCarouseImage() {
    const carouseImgList = ref<ICarouse[]>([
        {
            uid: '1',
            title: 'title1',
            url: 'https://ts1.cn.mm.bing.net/th/id/R-C.5b9944d55e9fa09e616f2ed482a54923?rik=YQKmNbaGqz5Uhg&riu=http%3a%2f%2fpic.616pic.com%2fbg_w1180%2f00%2f06%2f23%2fHESXm44YZG.jpg!%2ffw%2f1120&ehk=x3MgXeLycEJ8M87apUKYawzpLwRWnv417zxvpmaSMxQ%3d&risl=&pid=ImgRaw&r=0',
            target: 'https://ts1.cn.mm.bing.net/th/id/R-C.5b9944d55e9fa09e616f2ed482a54923?rik=YQKmNbaGqz5Uhg&riu=http%3a%2f%2fpic.616pic.com%2fbg_w1180%2f00%2f06%2f23%2fHESXm44YZG.jpg!%2ffw%2f1120&ehk=x3MgXeLycEJ8M87apUKYawzpLwRWnv417zxvpmaSMxQ%3d&risl=&pid=ImgRaw&r=0'
        },
        {
            uid: '2',
            title: 'title2',
            url: 'https://ts1.cn.mm.bing.net/th/id/R-C.5b9944d55e9fa09e616f2ed482a54923?rik=YQKmNbaGqz5Uhg&riu=http%3a%2f%2fpic.616pic.com%2fbg_w1180%2f00%2f06%2f23%2fHESXm44YZG.jpg!%2ffw%2f1120&ehk=x3MgXeLycEJ8M87apUKYawzpLwRWnv417zxvpmaSMxQ%3d&risl=&pid=ImgRaw&r=0',
            target: 'https://ts1.cn.mm.bing.net/th/id/R-C.5b9944d55e9fa09e616f2ed482a54923?rik=YQKmNbaGqz5Uhg&riu=http%3a%2f%2fpic.616pic.com%2fbg_w1180%2f00%2f06%2f23%2fHESXm44YZG.jpg!%2ffw%2f1120&ehk=x3MgXeLycEJ8M87apUKYawzpLwRWnv417zxvpmaSMxQ%3d&risl=&pid=ImgRaw&r=0'
        }
    ])

    function hrefTo(url: string) {
        window.open(url, '_blank');
    }

    return {
        carouseImgList, hrefTo
    }
}